package pacman.entries.pacman.meta_graph.features;

import pacman.entries.pacman.meta_graph.IMetaGraphFeature;
import pacman.entries.pacman.meta_graph.IMetaGraphObject;
import pacman.entries.pacman.meta_graph.MetaGraphNode;
import pacman.game.Game;
import pacman.game.Constants.DM;
import pacman.game.Constants.MOVE;

public class NodeFeatureAlreadyMovingThisWay implements IMetaGraphFeature {

	@Override
	public float Evaluate(IMetaGraphObject object, Game game) {
		
		MetaGraphNode node = (MetaGraphNode) object;
		
		MOVE lastMove = game.getPacmanLastMoveMade();
		MOVE moveToNode = game.getNextMoveTowardsTarget(game.getPacmanCurrentNodeIndex(), 
				node.MazeIndex(), DM.PATH);
		
		if (lastMove == moveToNode)
			return 6.0f;
		
		return 0;
	}

}
